<template>
   <div>
    <h2>我身上一共有{{moneyCount}}元</h2>
    <button @click="eat">吃饭</button>
    <button @click="speel">住宾馆</button>
    <button @click="work">搬砖</button>
    <button @click="an">按摩</button>
   </div>
</template>

<script>
export default {
  name:'demo-anli',
  data() { 
    return {
      moneyCount:1000000
    }
  },
  methods: {
    eat() { 
      this.moneyCount-=200
    },
    speel() { 
      this.moneyCount-=599
    },
    work() { 
      this.moneyCount+=100000
    },
    an() { 
      this.moneyCount-=29999
    }
   }
}
</script>